package com.gong.DesignPattern.StrategyPattern;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/7/6 0006 9:13
 */
public class Test {

    public static void main(String[] args) {
        Context context = new Context();
        context.setStrategy(new OperationAdd());
        System.out.println(context.executeStrategy(10, 10));

        context.setStrategy(new OperationMultiply());
        System.out.println(context.executeStrategy(10,10));

        context.setStrategy(new OperationSubtract());
        System.out.println(context.executeStrategy(10,10));
    }
}
